package com.gitee.farmer.im.rabbit.sender;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

/**
 * @author tech-farmer
 * @ClassName: Sender
 * @Description: (这里用一句话描述这个类的作用)
 * @date 2022/2/24 16:56
 */
@Component
@EnableBinding(OutputFarmerMessage.class)
public class Sender {

    @Autowired
    private OutputFarmerMessage OutputFarmerMessage;

    public void send(String msg){
        OutputFarmerMessage.output().send(MessageBuilder.withPayload(msg).build());
    }
}
